<div class="form-group row">
  <label for="" class="col-md-2 col-form-label">{{$label??''}}</label>
  <div class="col-md-9">
    <select name="{{$name??''}}" class="form-control">
      <option value="">{{$default_text??'请选择'}}</option>
      @foreach ($categories as $v)
      	@if($v->subcates()->exists())
      	<optgroup label="{{$v->name}}"></optgroup>
      		@foreach($v->subcates as $v1)
      		<option value="{{$v1->id}}" @if($default == $v1->id) selected @endif>
               ----{{$v1->name }}
          </option>
            @endforeach
      	@else
      		<option value="{{$v->id}}" @if($default == $v->id) selected @endif>
             ---- {{ $v->name }}
            </option>
      	@endif
      @endforeach
    </select>
  </div>
</div>